package org.lionel.event;

import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

//也可以使用@EventListener监听事件
@Component
@Order(1)
public class CouponUserRegisterListener {
    @EventListener
    public void sendCoupon(UserRegisterEvent event) {
        System.out.println(Thread.currentThread().getName()+"-给用户"+event.getUserName()+"发送优惠券!");
    }
}